<template>
    <div>
        <div  v-for="item of wz" :key="item.id">
            <div class="clo" @click="handleclick(item._id)">
                <div> 
                    <p>{{item.detail |handleString}}</p>
                    <p>{{item.title}}</p>
                </div>
                <img :src="item.headImgSrc" alt="" >
            </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    

    data() {
        return {
           wz:[] 
        };
    },

    mounted() {
        axios.get("http://122.112.161.135:3000/api/article").then(res=>{
            // console.log(res.data.res);
            this.wz = res.data.res
        })
    },
    methods: {
        handleclick(id){
            // console.log(id);
            this.$router.push(`/detail/${id}`)
        }
    },
};
</script>

<style  scoped>

.clo{
    padding: 20px;
    height: 200px;
    font-size: 30px;
    color: gray;
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.clo>img{
    width: 150px;
    height: 150px;
    margin-left: 20px;
}
.clo>div{
    height: 100%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}
</style>